#include <iostream>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <vector>
#include <map>
#include <queue>
#include <cstdio>
#include <string>
#include <stack>
#include <set>
#define IOS ios::sync_with_stdio(false), cin.tie(0)
using namespace std;
typedef long long ll;
ll d[110][2];
ll n;

bool judge(ll x,ll y){
    ll cnt=0;
    for(ll i=0;i<=n-1;i++){
        ll x1=d[i][0];
        ll y1=d[i][1];
        ll x2=d[(i+1)%n][0];
        ll y2=d[(i+1)%n][1];
        if(y1>y2){
            swap(y1,y2);
            swap(x1,x2);
        }
        if(y2<y||y1>y||y1==y2)continue;
        if(y1<=y&&y2>y){
            ll p1_x=x2-x;
            ll p1_y=y2-y;
            ll p2_x=x1-x;
            ll p2_y=y1-y;
            ll flag=p1_x*p2_y-p1_y*p2_x;
            if(flag>0)cnt++;
        }
    }
    if(cnt&1)return true;
    else return false;
}

int main()
{
    IOS;
    cin>>n;
    for(ll i=0;i<n;i++){
        cin>>d[i][0]>>d[i][1];
    }    
    ll max_x,max_y,min_x,min_y;
    max_x=min_x=d[0][0];
    min_y=max_y=d[0][1];
    for(ll i=1;i<n;i++){
        max_x=max(max_x,d[i][0]);
        min_x=min(min_x,d[i][0]);
        max_y=max(max_y,d[i][1]);
        min_y=min(min_y,d[i][1]);
    }
    ll ans=0;
    for(ll i=min_x;i<max_x;i++){
        for(ll j=min_y;j<max_y;j++){
            if(judge(i,j)&&judge(i+1,j)&&judge(i,j+1)&&judge(i+1,j+1)){
                ans++;
            }
        }
    }
    cout<<ans<<endl;
    getchar();
    getchar();
    return 0;
}
